#ifndef ATTRIBUTES_H
#define ATTRIBUTES_H

#include "Troll3D_global.h"

#include "GeoTool/vec4.h"

#include <GL/glew.h>
#include <vector>

/*! @brief GLSL vertex attributes
 *          So, basically, this class will be used to determine the overall "structure" of the application vertex
 *          Standard is to have the vertex position, color, normal and some uv's, but It could be whatever, according
 *          to the developper need.
 *          This was move from a struct to a class to "automatized" some treatments by having a vector of vec4 *
 *          who could be proceed by the "Array()" method in Vertex, whatever number of attributes have  been specified  */


class TROLL3DSHARED_EXPORT Attributes
{
    public :
    /********************************************
    /*              Public
    /********************************************/

        /********************************************
        /*              Constructor
        /********************************************/

            Attributes();
            Attributes(vec4 *position);
            Attributes(vec4 *position, vec4 *color);
            Attributes(vec4 *position, vec4 *color, vec4 *normal);
            Attributes(vec4 *position, vec4 *color, vec4 *normal, vec4 *texCoord);

            Attributes(const Attributes & copy);
            void Init( vec4 *position, vec4 *color, vec4 *normal, vec4 *texCoord);

            /*! @brief This function will feeed references inside m_Attributes  */
            void StoreReference();

        /****************************************
        /*              Members
        /****************************************/

            vec4 *m_Position;        /*!< Vertex's position in space */
            vec4 *m_Color;           /*!< Vertex's Color             */
            vec4 *m_Normal;          /*!< Vertex's normal, very important for light and orientation  */
            vec4 *m_Texcoord0;       /*!< Uv, very important for texturing                           */

            std::vector<vec4 *> m_Attributes;   /*!< This vector will store reference to all the Attributes. This will give more freedom
                                                 *   as the structure of attributes could then be modified if needed
                                                 */



    /****************************************/
    /*              Static                  */
    /****************************************/

        /****************************************/
        /*              Properties              */
        /****************************************/

            static std::vector<GLuint> m_Index;        /*!< GLSL attributes index      */

        /****************************************/
        /*              Methods                 */
        /****************************************/

            static void BindAttribute();
            static void UnbindAttributes();



};
#endif // ATTRIBUTES_H
